// 卡牌24点
// 给定4个数，范围1-9，判断是否可以组合成24点
#include <bits/stdc++.h>
using namespace std;

int comb_op_3(int b, int c, int d, char op1, char op2) {
    // int res = numeric_limits<int>::min();
    switch (op1)
                {
                case '+':
                    b = b + c;
                    break;
                case '-':
                    b = b - c;
                    break;
                case '*':
                    b = b * c;
                    break;
                case '/':
                    if (c != 0)
                        b = b / c;
                    else 
                        b = numeric_limits<int>::max();
                    break;
                default:
                    // should not go here
                    break;
                }
                switch (op2)
                {
                case '+':
                    b = b + d;
                    break;
                case '-':
                    b = b - d;
                    break;
                case '*':
                    b = b * d;
                    break;
                case '/':
                    if (d != 0)
                        b = b / d;
                    else 
                        b = numeric_limits<int>::max();
                    // b = b / d;
                    break;
                default:
                    // should not go here
                    break;
                }
    return b;
}

bool judge(int a, int b, int c, int d) {
    bool res = false;
    string op = "+-*/";
    int comb_res;
    int comb_res1, comb_res2, comb_res3;
    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j <4; ++j) {
            for (int k = 0; k < 4; ++k) {
                switch (op[i])
                {
                case '+':
                    comb_res = a + b;
                    break;
                case '-':
                    comb_res = a - b;
                    break;
                case '*':
                    comb_res = a * b;
                    break;
                case '/':
                    comb_res = a / b;
                    break;
                default:
                    // should not go here
                    break;
                }
                comb_res1 = comb_op_3(c, d, comb_res, op[i], op[j]);
                comb_res2 = comb_op_3(c, comb_res, d,  op[i], op[j]);
                comb_res3 = comb_op_3(comb_res, c, d,  op[i], op[j]);

                if (comb_res3 == 24 || (comb_res2 == 24) || (comb_res1 == 24)) {
                    res = true;
                    return res;
                }
            }
        }
    }
    return res;
}

int main() {
    vector<int> card(4);
    int tmp;
    for (int i = 0; i < 4; ++i) {
        cin >> tmp;
        card[i] = tmp;
    }

    // 
    bool res = false;
    if (judge(card[0], card[1], card[2], card[3]) || judge(card[1], card[0], card[2], card[3]) || judge(card[2], card[0], card[1], card[3]) || judge(card[3], card[0], card[1], card[2]) || 
        judge(card[0], card[2], card[1], card[3]) || judge(card[1], card[2], card[0], card[3]) || judge(card[2], card[1], card[0], card[3]) || judge(card[3], card[1], card[2], card[3]) ||
        judge(card[0], card[3], card[1], card[2]) || judge(card[1], card[3], card[0], card[2]) || judge(card[2], card[3], card[0], card[1]) || judge(card[3], card[2], card[0], card[1]) ||
        judge(card[0], card[1], card[3], card[2]) || judge(card[1], card[0], card[3], card[2]) || judge(card[2], card[0], card[3], card[1]) || judge(card[3], card[0], card[2], card[1]) ||
        judge(card[0], card[2], card[3], card[1]) || judge(card[1], card[2], card[3], card[0]) || judge(card[2], card[1], card[3], card[0]) || judge(card[3], card[1], card[2], card[0]) ||
        judge(card[0], card[3], card[2], card[1]) || judge(card[1], card[3], card[2], card[0]) || judge(card[2], card[3], card[1], card[0]) || judge(card[3], card[2], card[1], card[1]))
        res = true;
    
    cout << (res?"true":"false");
    return 0;
}